﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace DotNETX.Utility.Forms
{
#if !DotNet4Client
    public class FolderSelectDialog:
            System.Windows.Forms.Design.FolderNameEditor
    {
        public FolderSelectDialog()
        {
            _FolderBrowser = new FolderBrowser();
        }

        public string DirectoryPath
        {
            get
            {
                return _FolderBrowser.DirectoryPath;
            }
        }

        protected FolderBrowser _FolderBrowser { get; set; }

        public DialogResult ShowDialog()
        {
            DialogResult dr = _FolderBrowser.ShowDialog();
            return dr;
        }
    }
#else
    public class FolderSelectDialog
    {
        public FolderSelectDialog()
        {
            _FolderBrowser = new FolderBrowserDialog();
        }

        public string DirectoryPath
        {
            get
            {
                return _FolderBrowser.SelectedPath;
            }
        }

        protected FolderBrowserDialog _FolderBrowser { get; set; }

        public DialogResult ShowDialog()
        {
            DialogResult dr = _FolderBrowser.ShowDialog();
            return dr;
        }
    }
#endif
}
